#include "stdio.h" main() { int n=0,m=1,x=2; if(!n)x=-1;if(m)x=x-2; if(x)x=3;printf("%d\n",x);}

来源:百度知道 编辑:UC知道 时间:2024/05/28 16:17:32

#include "stdio.h";
void main()
{
int n=0,m=1,x=2;
if(!n)
x=-1;
if(m)
x=x-2;
if(x)
x=3;
printf("%d\n",x);
}

main() 不可以和预定义头文件放在同一行,所以出现错误。
改为:
#include "stdio.h"
main() { int n=0,m=1,x=2; if(!n)x=-1;if(m)x=x-2; if(x)x=3;printf("%d\n",x);}
即可。